class BookQL {
  final String updateTime;
  final String stereoscopicId;
  final String stereoscopicName;
  final String brief;
  final String author;
  final String coverUrl;
  final String pressName;
  final String isbn;



  final int forkCount;
  final int starCount;
  final int watcherCount;
  final bool isFork;
  final bool isStared;

  BookQL({
    this.updateTime,
    this.stereoscopicId,
    this.stereoscopicName,
    this.brief,
    this.author,
    this.coverUrl,
    this.pressName,
    this.isbn,
    this.forkCount,
    this.starCount,
    this.watcherCount,
    this.isFork,
    this.isStared,
  });

  static fromMap(Map map) {
    List<String> topics = [];
    if (map == null) {
      return null;
    }
    return BookQL(
      updateTime: map["updateTime"],
      stereoscopicId: map["stereoscopicId"].toString(),
      stereoscopicName: map["stereoscopicName"],
      brief: map["brief"],
      author: map["author"],
      coverUrl: map["coverUrl"],
      pressName: map["pressName"],
      isbn: map["isbn"],

      forkCount: map["forkCount"],
      watcherCount: map["watchers"],
      starCount: map["stargazers"],
      isFork:false,
      isStared: false,

    );
  }

  static toMap(BookQL repositoryQL) {
    if (repositoryQL == null) {
      return null;
    }
    var map = {
      "updateTime": repositoryQL.updateTime,
      "stereoscopicId": repositoryQL.stereoscopicId,
      "stereoscopicName": repositoryQL.stereoscopicName,
      "brief": repositoryQL.brief,
      "author": repositoryQL.author,
      "coverUrl": repositoryQL.coverUrl,
      "pressName": repositoryQL.pressName,
      "isbn": repositoryQL.isbn,
      "forkCount": repositoryQL.forkCount,
      "starCount": repositoryQL.starCount,
      "watcherCount": repositoryQL.watcherCount,
      "isFork": repositoryQL.isFork,
      "isStared": repositoryQL.isStared,

    };

    return map;
  }
}
